package com.gfm.story.entity.base;

public class PageBean {
    private Integer page;
    private Integer rows;
    private int start;

    public int getStart() {
        if(this.page == null || (this.page!=null && this.page.intValue() == 0)){
            this.page = 1;
        }
        if(this.rows == null || (this.rows!=null && this.rows.intValue() == 0)){
            this.rows = 20;
        }
        return (this.page-1)*this.rows;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public Integer getPage() {
        if(this.page == null){
            this.page = 0;
        }
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        if(this.rows == null){
            this.rows = 10;
        }
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "page=" + page +
                ", rows=" + rows +
                ", start=" + start +
                '}';
    }
}
